package com.ruoyi.project.system.goods.fee.service.impl;

import javax.annotation.Resource;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ruoyi.common.utils.uniquekey.IdGererateFactory;
import com.ruoyi.project.system.goods.fee.mapper.GoodsPostFeeMapper;
import com.ruoyi.project.system.goods.fee.domain.GoodsPostFee;
import com.ruoyi.project.system.goods.fee.service.IGoodsPostFeeService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 商品 邮费Service业务层处理
 * 
 * @author LCL
 * @date 2020-06-12
 */
@Service
public class GoodsPostFeeServiceImpl implements IGoodsPostFeeService 
{
    @Resource
    private IdGererateFactory idGererateFactory;
    @Autowired
    private GoodsPostFeeMapper goodsPostFeeMapper;

    /**
     * 查询商品 邮费
     * 
     * @param id 商品 邮费ID
     * @return 商品 邮费
     */
    @Override
    public GoodsPostFee selectGoodsPostFeeById(String id)
    {
        return goodsPostFeeMapper.selectGoodsPostFeeById(id);
    }

    /**
     * 查询商品 邮费列表
     * 
     * @param goodsPostFee 商品 邮费
     * @return 商品 邮费
     */
    @Override
    public List<GoodsPostFee> selectGoodsPostFeeList(GoodsPostFee goodsPostFee)
    {
        return goodsPostFeeMapper.selectGoodsPostFeeList(goodsPostFee);
    }

    /**
     * 新增商品 邮费
     * 
     * @param goodsPostFee 商品 邮费
     * @return 结果
     */
    @Override
    public int insertGoodsPostFee(GoodsPostFee goodsPostFee)
    {
        goodsPostFee.setId(this.idGererateFactory.nextStringId());
        return goodsPostFeeMapper.insertGoodsPostFee(goodsPostFee);
    }

    /**
     * 修改商品 邮费
     * 
     * @param goodsPostFee 商品 邮费
     * @return 结果
     */
    @Override
    public int updateGoodsPostFee(GoodsPostFee goodsPostFee)
    {
        return goodsPostFeeMapper.updateGoodsPostFee(goodsPostFee);
    }

    /**
     * 删除商品 邮费对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteGoodsPostFeeByIds(String ids)
    {
        return goodsPostFeeMapper.deleteGoodsPostFeeByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除商品 邮费信息
     * 
     * @param id 商品 邮费ID
     * @return 结果
     */
    @Override
    public int deleteGoodsPostFeeById(String id)
    {
        return goodsPostFeeMapper.deleteGoodsPostFeeById(id);
    }

    @Override
    public int deleteByGoodsId(String goodsId) {
        return this.goodsPostFeeMapper.deleteByGoodsId(goodsId);
    }

    @Override
    public List<GoodsPostFee> findListByGoodsId(String gId) {
        return this.goodsPostFeeMapper.findListByGoodsId(gId);
    }
}
